package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_prizes_record", schema = "", catalog = "onedollar")
public class TPrizesRecordEntity {
    private int id;
    private Integer userId;
    private Integer prizesId;
    private Timestamp addTime;
    private Integer status;
    private Integer peer;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id", nullable = true, insertable = true, updatable = true)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "prizes_id", nullable = true, insertable = true, updatable = true)
    public Integer getPrizesId() {
        return prizesId;
    }

    public void setPrizesId(Integer prizesId) {
        this.prizesId = prizesId;
    }

    @Basic
    @Column(name = "add_time", nullable = true, insertable = true, updatable = true)
    public Timestamp getAddTime() {
        return addTime;
    }

    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "status", nullable = true, insertable = true, updatable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "peer", nullable = true, insertable = true, updatable = true)
    public Integer getPeer() {
        return peer;
    }

    public void setPeer(Integer peer) {
        this.peer = peer;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TPrizesRecordEntity that = (TPrizesRecordEntity) o;

        if (id != that.id) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        if (prizesId != null ? !prizesId.equals(that.prizesId) : that.prizesId != null) return false;
        if (addTime != null ? !addTime.equals(that.addTime) : that.addTime != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        if (peer != null ? !peer.equals(that.peer) : that.peer != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (prizesId != null ? prizesId.hashCode() : 0);
        result = 31 * result + (addTime != null ? addTime.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (peer != null ? peer.hashCode() : 0);
        return result;
    }
}
